Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Set variable based on another field

Hi All,

I have 2 fields, Period and QTR, the table looks like the following..

 

PeriodQTR
11
21
31
42
52
62
72
83
93
103
114
124
13

4

What i want to do is to set a variable vCurrentQTR to use the QTR linked to the another variable vCurrentPeriod.

So vCurrentPeriod is 12, so i would want the vCurrentQTR variable to be set at 4.

Can anyone help please?

1 Solution

Accepted Solutions
sunny_talwar

Use this

=Only({<Period = {'$(vCurrentPeriod)'}>}Qtr)

View solution in original post

8 Replies
sunny_talwar

May be like this

Only({<Period = {'$(vCurrentQTR)'}>}QTR)

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi Sunny,

That doesn't seem to be correct,

What i need is to use an action to set the vCurrentQTR to the current QTR based on the vCurrentPeriod variable.

So in the attached the vCurrentPeriod = 12.

in the table, P12 = QTR 4.

So i want the vCurrentQTR variable to show 4

does that make sense? !

sunny_talwar

Use this

=Only({<Period = {'$(vCurrentPeriod)'}>}Qtr)

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Damn, i tried that but i copied and pasted your first reply and changed the variable but the field name was uppercase and my real data is lowercase!

Thanks!

i don't suppose you have any ideas about my post yesterday?

sunny_talwar

Not yet... I have not got a chance to look at it ... too complicated to solve quickly

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

OK , sorry its so complicated!

sunny_talwar

You don't have to sorry... it is me who is sort of lazy...

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

haha! well i would appreciate the help when you have the time.

Many thanks!