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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating basic if statement expression in chart

I am very new to Qlikview and have a basic chart of containing timesheet data.

I would like to break out into separate columns a series of paycode values with associated hours by testing with an IF statement for a particular paycode and return the hours for that paycode.

I completely understand the normal construct for an IF statement, but just cannot get the syntax correct in my chart.

Any help would be appreciated.

alathwell 

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps using a pivot table is an option. Add paycode as dimension and drag it to the right above the expression(s). Once you see a thick blue horizontal line you can let go and the paycode values should be shown horizontally as columns.

If you want to restrict that dimension to specific value you can use a listbox and select the values. Or you can use a calculated dimension like =match(paycode,'value1','value2',....,'valueN'). Or put the filter in the expression. Sum(hours) would become sum({<paycode={'value1','value2',..,'valueN'}>}hours).


talk is cheap, supply exceeds demand
israrkhan
Specialist II
Specialist II

not clear to me,

if you want to break a value in to multiple value, you can use Left(), right(); mid() functions..

or kindly elaborate a bit more, show us the data...

Clever_Anjos
Employee
Employee

Maybe you can use Set Analysis to separate

Column1 = sum({<paycode={"001"}>}hours)

Column2 = sum({<paycode={"002"}>}hours)

and so on

Set Analysis is usualy a better approach then 'if´s'