Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table on my dashboard in a similar format as follow:
ID | Name | Country | Account Number |
---|---|---|---|
1 | Name1 | Country1 | 1111 |
2 | Name2 | Country2 | - |
3 | Name3 | Country3 | - |
4 | Name4 | Country4 | 2222 |
5 | Name5 | Country5 | - |
I need to add a filter/flag on my dashboard in a list box for 'Account Number' field. The header for the list box is something like 'Account Number null?', then the list box would have two selections: 'Yes' and 'No'. So selecting 'Yes' will show only rows with IDs 2, 3 and 5 while 'No' will return the table with rows 1 and 4.
Thanks in advance.
Thanks all for your help. All the suggestions make sense but still didn't get my problem solved 100%. After a few researches, it turned out that it's tricky how QlikView handles the null values. I read a great document from this thread and concluded that converting null values to a string, e.g. <NULL>, in the load script and then applying your suggested script did the trick.
=If(([Account Number])<>'<NULL>','No','Yes')
PS: data source from SQL Server
Is this a table box or straight table?
Table box.
May be this in script?
LOAD ID,
Name,
Country,
[Account Number],
If([Account Number]='-', 'Yes', 'No') as NullFlag
FROM
[https://community.qlik.com/message/1262813]
(html, codepage is 1252, embedded labels, table is @1);
Thanks.
Is there a way to add the flag directly on the dashboard rather from the loading script?
I'm loading my data from SQL server.
Create a list box and in the expression use the below code :
=If(Left([Account Number],1)='-','Yes','No')
NP, Just add one line script after generating the code.
Connection string of SQL Server
Load *,
If([Account Number]='-', 'Yes', 'No') as NullFlag
From <Data Source od SQL Server>;
Try using straight table like in attached sample.
Thanks.
I'm having a big table box with a lot of data, so a solution that could work with a table box will be highly appreciated.
Also, for the list box, is there a possibility to have 'Yes' and 'No' as a check boxes? i.e. It will be allowed also to display the table with all the data (if 'Yes' and 'No' are not checked).
Actually the values are null and not '-'. I guess QlikView displays nulls as '-' in tables.
Will a similar syntax as SQL work here as well? i.e. If([Account Number]) is NULL...