Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping Color Code

Hi,

Below are the details and the required output.

P_color_code is the color code of each project. P_name is the project associated with it.

Level1 is the list of all projects that are in P_name and there are few other.

When i select from Level1 the color disappears this is bcoz of association that has not happened with Level1.

Please help me how to create a new Color_code for Level1.

Please find the attached Qvw.

Thanks,

Keerthi KS

4 Replies
Kushal_Chawda

Put below condition in background colour of P_name

=only({1}P_Color_Code)

Not applicable
Author

This works for P_name.

But i need to join P_color_code  for Level1.

Level1 has different data along with P_name data.

jagan
Luminary Alumni
Luminary Alumni

Hi,

I checked your datamodel  there are some rows with empty color codes.  Split that into tables.

Projects:

LOAD

    uniqueid as P_ID, 

    state as P_State,

    name as P_Name,

    if(Len(launchdat2)=0,Date($(vDateMin)),

    Date(Floor(Num(launchdat2)))

    ) as P_Date,

    Date(if(len(validtill)=0,Today())) as P_Valid_Date,

    if(IsNum(code),Num(code),code) as P_Code,

     if(IsNum(code),Num(code),code) as PROJECTID,

    colorcode as P_Color_Code2,  

    projectlogo as P_Logo,

    shortname as P_Short_Name,

    //commonpricebook as CPB_ID,

    city as City,

    zone as Zone,

    pincode as Pincode,

    country as Country,

    launchdat2 as Launch_Date

FROM

[$(vPath)\teproject.qvd]

(qvd)

ColorCodes:

LOAD

*

WHERE Len(Trim(P_Color_Code)) > 0;

LOAD

P_Name,

RGB(

           16 * Match(Upper(Mid(Replace(colorcode,'#',''),1,1)), $(vHexDigits))

              + Match(Upper(Mid(Replace(colorcode,'#',''),2,1)), $(vHexDigits)),

           16 * Match(Upper(Mid(Replace(colorcode,'#',''),3,1)), $(vHexDigits))

              + Match(Upper(Mid(Replace(colorcode,'#',''),4,1)), $(vHexDigits)),

           16 * Match(Upper(Mid(Replace(colorcode,'#',''),5,1)), $(vHexDigits))

              + Match(Upper(Mid(Replace(colorcode,'#',''),6,1)), $(vHexDigits))

      ) AS P_Color_Code

FROM

[$(vPath)\teproject.qvd]

(qvd);

HOpe this helps you.

Regards,

Jagan.

Not applicable
Author

HI Jagan,

Separated the tables. But this ended up with some data error.

How to create separate color_code for Level1. Level1 has many elements including P_name elements. Color_code only for Level1

Regards,

Keerthi KS