Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
gauravsinghtomar
Contributor II
Contributor II

How to create new Variable based on another multiple Variable using if, else statement ??

 

Hi, I am looking for any advice on how to create variable and call in Qlik Sense report. 

Q. How to create a new variable using (filter, if, if else statement) on a different variable on the same calculated field? Please find the attached document of this power bi DAX Queries? Is the syntax similar in Qlik Sense or any option?

Power BI DAX Queries given below. I need syntax similar to these:-

Column1Column2Column3Column4Column5Permission.Check
1PermissionJohn AllowPermission
1PermissionJohn AllowPermission
1DeleteJohn AllowPermission
2PermissionJohn AllowDelete
2PermissionJohn AllowDelete
2DeleteJohn AllowDelete
2DeleteJohn AllowDelete
3PermissionJohn Allow 
3DeleteJohn Allow 
4PermissionJohnXYZAllow 
4DeleteJohn Deny 

 

Permissions.Check =

VAR Permissions = CALCULATE(COUNTROWS(TableName),ALLEXCEPT(TableName,TableName[column1],tableName[column2]))

VAR Delete =
    CALCULATE(
        COUNTROWS(TableName),
            FILTER(
                ALLEXCEPT(TableName,TableName[column1],TableName[column2]),
                    TableName[column3]="John"&&
                    ISBLANK(TableName[column4])
                )
            )

RETURN
SWITCH(TRUE(),
    TableName[column5]<>"Allow",BLANK(),

    Permissions=2&&Delete=1,"Permission",

    Permissions=2&&Delete=2,"Delete",

   BLANK()

)
Labels (2)
10 Replies
killersswang
Contributor II
Contributor II

From my point of view Variables in Dax(Power BI)  and Variable in Qlik is  different.