Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
IMPORTANT: Upcoming LEF Database Maintenance, Oct. 3rd - SEE DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Partner
Partner

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
Highlighted
Partner
Partner

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

Highlighted
Creator
Creator

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

 

 

Highlighted
Partner
Partner

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