Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
BootCam
Creator
Creator

Calculated Dimension in Straight Table

Hi,

I am trying to create a calculated dimension filed in a straight table in qlikview based on some conditions.

Please see the attached file for more details:

clipboard_image_0.png

Let me know if you have any questions.

 

Thanks,

BC

Labels (2)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

Dont know your full requirement but you could do it script like below

 

ExampleTemp:
LOAD AC, 
     ID, 
     Category
FROM
[C:\Users\DR\Downloads\example (1).xlsx]
(ooxml, embedded labels, header is 2 lines, table is Sheet1);

left join
load ID,
	if(Category='Ex',AC) as [New Field (AC2) to be created]
resident ExampleTemp
where Category='Ex';

NoConcatenate
Example:
load
	 AC, 
     ID, 
     Category,
     if(len([New Field (AC2) to be created])=0,'UNASSIGNED',[New Field (AC2) to be created]) as [New Field (AC2) to be created]
resident ExampleTemp;

drop table ExampleTemp;

 

 

Output

AC ID Category New Field (AC2) to be created 
OC349AtUNASSIGNED
TAP225LbUNASSIGNED
COR197ExCOR
IP197LbCOR
IR197AtCOR
OC197AtCOR
PE197AtCOR
TAP197LbCOR
IP122LbUNASSIGNED
IR122AtUNASSIGNED
SE122StUNASSIGNED

View solution in original post

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

Dont know your full requirement but you could do it script like below

 

ExampleTemp:
LOAD AC, 
     ID, 
     Category
FROM
[C:\Users\DR\Downloads\example (1).xlsx]
(ooxml, embedded labels, header is 2 lines, table is Sheet1);

left join
load ID,
	if(Category='Ex',AC) as [New Field (AC2) to be created]
resident ExampleTemp
where Category='Ex';

NoConcatenate
Example:
load
	 AC, 
     ID, 
     Category,
     if(len([New Field (AC2) to be created])=0,'UNASSIGNED',[New Field (AC2) to be created]) as [New Field (AC2) to be created]
resident ExampleTemp;

drop table ExampleTemp;

 

 

Output

AC ID Category New Field (AC2) to be created 
OC349AtUNASSIGNED
TAP225LbUNASSIGNED
COR197ExCOR
IP197LbCOR
IR197AtCOR
OC197AtCOR
PE197AtCOR
TAP197LbCOR
IP122LbUNASSIGNED
IR122AtUNASSIGNED
SE122StUNASSIGNED
BootCam
Creator
Creator
Author

Hi Dilipranjith,

Thank you so much for the solutions. I am very tempted to accept as the solutions i needed but i was trying to do it on the UI(Chart) side.  Is there any way we could do it in the chart as a Conditional dimensions.

 

Thanks,

BC

 

 

dplr-rn
Partner - Master III
Partner - Master III

not sure how feasible that is. but definitely would be slower than the script solution