Discussion Board for collaboration related to QlikView App Development.
I have a field called [Day Part] where the values are 1, 2, 3, 4, etc.
I want to create a variable called vName that picks the values when [Day Part] = 11, 12, 13, 14, 15, 16, 17
Can you explain more, you want one or multiple variable? In script while loading [Day Part]?
May be try this in your variable like
If values are strings put them in quotes.
vName = Concat(DISTINCT Pick(Match([Day part], 11, 12, 13, 14, 15, 16), 'Value1', 'Value2', 'Value3', 'Value4', 'Value5'), '|')
If you want the variable to have assigned value (single) only when the [Day Part] would be selected in that range, you could simply try like:
vName= If([Day Part]>10 and [Day Part]<17, [Day Part])
If you want to consider multiple values in-scope as well, may try like:
vName= Concat( Distinct If([Day Part]>10 and [Day Part]<17, [Day Part]) , ',' ) // comma separated values
I think this is probably the right answer, but I have some missteps.
Let me start with my ultimate goal. I want to have a current selections box. Currently, I have a button that says 'Lunch,' which is equal to when [Day Part] = 11, 12, 13, 14, 15, 16.
I get the field [Day Part] via a transformation in my script:
[Business Hour] AS Time,
Hour([Business Hour]) AS [Day Part],
Time shows as 11:00 AM, 12:00 PM, etc.
Day Part shows as 11, 12, 13, etc/
So, currently, when a user clicks the 'Lunch' button, the current selections box shows [Day Part] (11|12|13|14|15|16)
I am trying to have the current selections box show 'Lunch'. Is there a better methodology to do this?