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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

multiple if

hello

i am new in qlikview

i have year dimension,

i want to show below expression

if(year=1391,count(if (mid(employee_date,1,4)<=1391  ,personel_code)),

if(year=1392,count(if (mid(employee_date,1,4)<=1392  ,personel_code)),

if(year=1393,count(if (mid(employee_date,1,4)<=1393  ,personel_code))

)))

how can i show this ??

regards

7 Replies
sudeepkm
Specialist III
Specialist III

i think you can simplify it at the script level by using an expression like below.

1. Create a new field such as Flag_emp, to create a flag per record where '1' indicates those records where the Year = Year of Employee_date

2. Load Year, ,

if(Year = mid(employee_date,1,4),1,0) as Flag_emp from <data srouce>

3. Use this field in your chart expression like below

Dimension: Year

Expression: count({<Flag_emp={1}>} personal_code)

dclark0699
Creator
Creator

I think this is likely best solved with a data model change. Could you attach a sample QVW where you are encountering the problem?

ecolomer
Master II
Master II

Can you explain more your question, please?

Not applicable
Author

thanks alot

but how to create new field ?

Not applicable
Author

i have a bar chart

dimension is year

i want to show number of personal in each year

number of my personal in each year is :

1392=10

1393=12

i want when i select 1393 in listbox , bar cahrt show 22

it means that when i select 1393 , equal no. of personal in 1392 + no. of personal in 1393

ecolomer
Master II
Master II

You can use acumulative option in the chart

Anonymous
Not applicable
Author

may be try:

Variable:

vMaxYear = Max(mid(employee_date,1,4))

Set Analysis:

=Count({$< Year ={'<=$(=vMaxYear)'}>} personel_code)